---
id: single
title: "single()"
slug: single
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Retrieves only one row from the result. Result must be one row (e.g. using
`limit`), otherwise this will result in an error.

<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
const { data, error } = await supabase
  .from('cities')
  .select('name, country_id')
  .single()
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>

















## Examples

### With `select()`



<Tabs
  defaultValue="js"
  groupId="libraries"
  values={[{ label: 'JavaScript', value: 'js' },{ label: 'Python', value: 'py' }]}>

<TabItem value="js">

```js
const { data, error } = await supabase
  .from('cities')
  .select('name, country_id')
  .single()
```


</TabItem>
<TabItem value="py">

```py
# Not yet implemented
```


</TabItem>

</Tabs>